import 'package:ac/page/ac_message/ac_message_logic.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get_rx/src/rx_types/rx_types.dart';
import 'package:rongcloud_im_wrapper_plugin/rongcloud_im_wrapper_plugin.dart';

class AcChatState {
  final conversation = Rxn<ACConversation>(null);
  final messages = <RCIMIWMessage>[].obs;
  final showMore = false.obs;
  final showSend = false.obs;
  final showVoice = false.obs;
  final voicing = false.obs;
  final voiceValid = true.obs;
  final timeSecond = 0.obs; // 用来做回显时长

  late FocusNode focusNode;

  late TextEditingController inputController;

  AcChatState() {
    ///Initialize variables
    focusNode = FocusNode();
    inputController = TextEditingController();
    focusNode.addListener(() {
      if (focusNode.hasFocus) {
        showMore.value = false;
        showSend.value = true;
      } else {
        showSend.value = false;
      }
    });
  }
}
